package hot100;

import DTO.TreeNode;

public class maxDepth {
    int max;
    public int maxDepth(TreeNode root) {
        max = 0;
        retcur(root,1);
        return max;
    }
    void retcur(TreeNode root, int len){
        if(root == null) {
            if(max < len -1) {
                max = len-1;
            }
            return;
        }
        retcur(root.left,len+1);
        retcur(root.right,len+1);
    }
}
